home *** CD-ROM | disk | FTP | other *** search
/ Colorado Rockies 2000 / Colorado Rockies 2000 by US West.iso / mac / xtras / Beatnik Xtra Lite / Beatnik Behaviors LiteD7.cst / 00001_Script_Play Groovoid Lite Behavior next >
Text File  |  1998-10-22  |  7KB  |  130 lines

  1. -- Play Groovoid Lite, a Beatnik Behavior
  2. -- by Paul Sebastien, pauls@sirius.com, http://www.bitstream.net/psykosonik
  3.  
  4. -- The 'Pro' version of this behavior will feature such additions as automatic instantiation of multiple unique Beatnik instances, control over fade in and fade out upon starting and stopping the Groovoid, access to several additional Groovoids in the 'Pro' soundbank, and more. For more info, go to http://www.headspace.com/
  5.  
  6.  
  7.  
  8.  
  9. global groovoidPlayer
  10.  
  11.  
  12.  
  13.  
  14. property pWhichGroovoid
  15. property pWhichEvent
  16. property pLoopState
  17.  
  18.  
  19. on getPropertyDescriptionList
  20.   
  21.   --  initialize the Beatnik Xtra instance for playing Groovoids
  22.   --  NOTE: you may want to instantiate multiple instances like the one below, using different instance names each time, in order to play back multiple Groovoid files simultaneously, if that's what you need to do. You can copy and paste this initializing script below and just change 'groovoidPlayer' to 'groovoidPlayer2' and 'groovoidPlayer3' and so on, for each instance, and then set the mouse event scripts or 'doIt' script to target these additional instances accordingly, depending on how many files you need to play at once. 
  23.   
  24.   
  25.   
  26.   put "------------------------------"
  27.   if ilk(groovoidPlayer) = #instance then stop(groovoidPlayer)
  28.   set groovoidPlayer = VOID
  29.   set groovoidPlayer = new(xtra "beatnik",TRUE)
  30.   set bankFileName = the moviePath & "patches.hsb"
  31.   put "groovoidPlayer =" && groovoidPlayer
  32.   put "Bank =" && bankFileName
  33.   put "SetSampleLibrary(groovoidPlayer) = " & setsampleLibrary(groovoidPlayer, bankFileName)
  34.   put "SetReady(groovoidPlayer) = " & setReady(groovoidPlayer)
  35.   put "isReady(groovoidPlayer) = " & isReady(groovoidPlayer)
  36.   if not(isReady(groovoidPlayer)) then
  37.     alert "The Beatnik Xtra did not initialize, the Beatnik soundbank file 'patches.hsb' must be in the same folder as your current Director movie is in (or modify the path in the script). Also, make sure that the Xtra (BEATNIK.X32) is added to this movie."
  38.     exit
  39.   end if
  40.   --  finished initializing the Beatnik Xtra instance for playing Groovoids
  41.   
  42.   
  43.   
  44.   
  45.   
  46.   
  47.   
  48.   
  49.   
  50.   set d = [:]
  51.   
  52.   addProp d, #pWhichGroovoid, [#default: "UI-BeepClick1", #format: #string, #range: ["UI-BeepClick1", "UI-CarriageReturn", "UI-MouseOverDrone1", "UI-OpenOrClose1", "UI-OpenOrClose2", "UI-OpenOrClose3", "UI-SimpleClick1", "UI-SimpleClick2", "UI-SystemBeep", "UI-TeletypeBurst2", "UI-TypeOneKey", "UI-Choice1", "UI-Question", "UI-Chimes", "UI-FunnyBeep","UI-Click1","UI-Click2","UI-Click3","UI-Click4","UI-Click5","UI-Click6","UI-Click7","UI-Click8","UI-Click9","UI-Click10","UI-Click11","UI-Click12","UI-Click13","UI-Click14","UI-Click15","UI-Click16","UI-Click17","UI-Click18","UI-Load1","UI-MouseOver1","UI-MouseOver2", "Hits-BlastOff", "Hits-Kicker1", "Hits-Kicker2", "Hits-Kicker5", "Hits-LudwigVan", "Hits-Magic", "Hits-MysteryChime", "Hits-SportsOrganCharge", "Hits-ZoomAndHit", "Fanfare-Arrival", "Fanfare-Cascade", "Fanfare-CorpSting1", "Fanfare-Finished", "Fanfare-Horserace", "Fanfare-Mars", "Fanfare-Majesty", "Fanfare-Presenting", "Fanfare-Sports", "Background-Beeps", "Background-Clock", "Background-Dubby", "Background-Funky", "Background-Groove2", "Background-InfoPulse", "Background-Latin", "Fanfare-News", "Background-Piano", "Background-SimpleTyping", "Background-Smooth", "Background-StillWaiting", "Background-Teletype", "Misc-CashRegister", "Misc-ThruPhoneRing"], #comment: "Choose a Groovoid to play"]
  53.   addProp d, #pWhichEvent, [#default: "mouseDown", #format: #symbol, #range: [#mouseDown, #mouseUp, #mouseEnter, #mouseLeave, #mouseWithin,#enterFrame,#exitFrame], #comment: "Choose a trigger event:"]
  54.   addProp d, #pLoopState, [#default: FALSE, #format: #boolean, #range: [TRUE, FALSE], #comment: "Looping:"]
  55.   
  56.   return d
  57. end
  58.  
  59.  
  60.  
  61. on doIt me
  62.   global groovoidPlayer
  63.   setLoop(groovoidPlayer, pLoopState)
  64.   playGroovoid(groovoidPlayer, pLoopState, pWhichGroovoid, )
  65.   
  66.   
  67. end
  68.  
  69.  
  70.  
  71. on mouseDown me
  72.   if the pWhichEvent of me = #mouseDown then doIt me
  73.   
  74. end
  75.  
  76.  
  77. on mouseUp me
  78.   if the pWhichEvent of me = #mouseUp then doIt me
  79.   
  80.   
  81.   
  82. end
  83.  
  84.  
  85. on mouseEnter me
  86.   if the pWhichEvent of me = #mouseEnter then doIt me
  87.   
  88. end
  89.  
  90.  
  91. on mouseLeave me
  92.   if the pWhichEvent of me = #mouseLeave then doIt me
  93.   
  94. end
  95.  
  96. on mouseWithin me
  97.   if the pWhichEvent of me = #mouseWithin then doIt me
  98.   
  99. end
  100.  
  101. on enterFrame me
  102.   if the pWhichEvent of me = #enterFrame then doIt me
  103.   
  104. end
  105.  
  106. on exitFrame me
  107.   if the pWhichEvent of me = #exitFrame then doIt me
  108.   
  109. end
  110.  
  111.  
  112.  
  113. on stopMovie
  114.   global groovoidPlayer
  115.   stop(groovoidPlayer)
  116.   closeBeatnik(groovoidPlayer)
  117.   set groovoidPlayer=VOID
  118.  
  119. end stopMovie
  120.  
  121.  
  122.  
  123. on getBehaviorDescription
  124.   
  125.   
  126.   set description = "PLAY GROOVOID LITE BEHAVIOR" && RETURN & "by Paul Sebastien pauls@sirius.com" && RETURN && RETURN & "This Beatnik Behavior allows you to trigger the playback of Groovoids, RMF music and sound FX files that are conveniently built into the soundbank (patches.hsb) that accompanies the Beatnik Xtra Lite." && RETURN && RETURN & "PARAMETERS:" && RETURN & "ò Choose a Groovoid to play:" && RETURN & "...Lets you choose which Groovoid to play." && RETURN && RETURN & "ò Choose a trigger event:" && RETURN & "...Lets you choose which Director event you want to start the playback of the Groovoid." && RETURN && RETURN & "ò Looping:" && RETURN & "...Whether the Groovoid should play over and over again or not."&& RETURN && RETURN & "IMPORTANT:" && RETURN &&RETURN & "- This behavior requires that the Beatnik Xtra Lite is properly added to your Director project, and also, the Beatnik soundbank (patches.hsb) must be in the same directory as your Director project file, otherwise you should change the path to the soundbank in this behavior's script if the soundbank resides elsewhere." && RETURN && RETURN & "- If you want to use this behavior to play multiple Groovoids simultaneously, you should modify the Beatnik instance name used in this behavior's script so it is different/unique for each instance. Currently, the instance name used is 'groovoidPlayer', so if using multiple Groovoids that need to play at the same time, you can modify the name in the script to 'groovoidPlayer2' and so on, as needed, to create multiple separate Groovoid players." && RETURN &&RETURN & "For more information on instantiating the Beatnik Xtra Lite, refer to the documentation or other Beatnik Xtra sample movies." && RETURN && RETURN & "To upgrade to Beatnik Behaviors Pro, or for more information on Beatnik-related products and music files, visit the Headspace web site at:" && RETURN && RETURN & "http://www.headspace.com"
  127.   
  128.   return description
  129. end
  130.